import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
import { CryptoService } from 'src/modules/crypto/crypto.service';
import { Public } from 'src/modules/auth/decorators/public.decorators';
@Controller()
export class AppController {
  constructor(
    private readonly appService: AppService,
    private readonly cryptoService: CryptoService
  ) {}

  @Public()
  @Get()
  getHello(): string {
    // return this.appService.getHello();
    const data = '123456';
    const encrypt = this.cryptoService.encrypt(data, '');
    const flag = this.cryptoService.verify(data, encrypt, '');
    console.log(`encrypt: ${encrypt}`);
    console.log(`flag: ${flag}`);
    console.log(`salt: ${this.cryptoService.salt}`);

    return encrypt;
  }
}
